//
//  SwiftUIView.swift
//  
//
//  Created by Hoa on 2021/7/28.
//

import SwiftUI

public struct HoImageButton: View {
    
    private let systemName: String
    private let action: (() -> Swift.Void)?
    
    public init(systemName: String, action: (() -> Swift.Void)?) {
        self.systemName = systemName
        self.action = action
    }
    
    public var body: some View {
        Button(action: {
                   action?()
                } ) {
                    Image(systemName: systemName)
                        .style(appStyle: .barButton)
                        .foregroundColor(.acText)
                }
                .buttonStyle(BorderedBarButtonStyle())
                .accentColor(Color.acText.opacity(0.2))
                .safeHoverEffect()
    }
}

struct HoImageButton_Previews: PreviewProvider {
    static var previews: some View {
        HoImageButton(systemName: "plus") {
            print("plus")
        }
    }
}
